home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / apidev / tpapi.exe / NWTTS.PA1 < prev    next >
Text File  |  1994-01-14  |  10KB  |  199 lines

  1. {#Z+}
  2. {(10U&l12D(s4099T&k2S}
  3. {***************************************************************************}
  4. {** Program : NWTTS                                                       **}
  5. {***************************************************************************}
  6. {** Version : 1.53            ** Started : 11/11/91  ** Ended :   /  /    **}
  7. {***************************************************************************}
  8. {******************************** Description ******************************}
  9. {***************************************************************************}
  10. {** OOP library for Netware API                                           **}
  11. {**                                                                       **}
  12. {** This unit forms the second level object : TTS                         **}
  13. {** This object is a descandent of          : NETWARE                     **}
  14. {**                                                                       **}
  15. {**                                                                       **}
  16. {**                                                                       **}
  17. {**                                                                       **}
  18. {***************************************************************************}
  19. {******************************** Information ******************************}
  20. {***************************************************************************}
  21. {** Provides Netware Transaction Tracking Services                        **}
  22. {**                                                                       **}
  23. {**                                                                       **}
  24. {**                                                                       **}
  25. {** This code is (c) 1991 - 1994 Antonio Covelli. ALL RIGHTS RESERVED.    **}
  26. {** Portions (c) Novell Inc,                                              **}
  27. {**                                                                       **}
  28. {**                                                                       **}
  29. {***************************************************************************}
  30.  
  31. {$I NETWARE.INC}
  32. {#Z-}
  33.  
  34. UNIT NWTTS;
  35.  
  36. INTERFACE
  37.  
  38. USES
  39.  
  40.   nwvar,
  41.   netware;
  42.  
  43. TYPE
  44.  
  45.   pTTSOBJ = ^TTSOBJ;
  46.   TTSOBJ  = OBJECT (NetwareOBJ)
  47.  
  48.     FUNCTION TTSAbortTransaction : WORD;
  49.     { Aborts explicit and implicit transactions. If a transaction is aborted,
  50.       all writes made since the beginning of the transaction are discarded. The
  51.       following record locks are released:}
  52.     {#F}
  53.     {}
  54.     {     Physical record locks generated by the file server when an application }
  55.     {     tried to write to am unlocked record. }
  56.     {}
  57.     {     Physical or logical locks that have not been released because of a }
  58.     {     file write. }
  59.     {#F}
  60.     {}
  61.     { For explicit transactions, the transaction is backed out and any locks
  62.       being held are released. }
  63.     {}
  64.     { For implicit transactions, if the number of logical or physical records
  65.       still locked exceeds the threshold, this function returns a completion
  66.       code of TRANSACTION_RESTART. In other words, the transaction is backed out
  67.       and the file server automatically starts a new implicit transaction. }
  68.  
  69.     FUNCTION TTSBeginTransaction : WORD;
  70.     { Begins an explicit transaction. After this function TTS traks all files
  71.       that are currently open and any files that are opened during the
  72.       transaction. Transaction files are not closed and unlocked until either
  73.       #TTSEndTransaction# or #TTSAbortTransaction# is executed. }
  74.  
  75.     FUNCTION TTSEndTransaction (VAR TransactionNumber : longint) : WORD;
  76.     { This function ends an explicit transaction and returns a Transaction
  77.       Number. A transaction is not necessarily completed to disk when this
  78.       function returns. The returned transaction number can be used by
  79.       #TTSTransactionStatus# to verify whether a transaction was successfully
  80.       committed to disk.
  81.  
  82.       If the file server fails before all transaction updates are written to
  83.       disk, the transaction will be backed out when the file server is rebooted,
  84.       unless transaction tracking is disabled. }
  85.     {#F}
  86.     {}
  87.     { TransactionNumber: contains the transaction number of the transaction
  88.                     just ended. This can be used by #TTSTransactionStatus# to
  89.                     verify whether the transaction was successfully written
  90.                     to disk. }
  91.     {#F}
  92.     {#X TTSAbortTransaction }
  93.  
  94.     FUNCTION TTSGetApplicationThresholds (VAR LogicalRecordLockThreshold,
  95.                                           PhysicalRecordLockThreshold : byte) : WORD;
  96.     { Allows an application to determine the number of logical and physical
  97.       record locks allowed before an implicit transaction is started. For
  98.       example, if a threshold value is 0 then when the first lock is made for
  99.       that particular lock an implicit transaction is started. Thus, if the
  100.       threshold is 50 then on the 51st lock an implicit transaction is started.
  101.       The default values for boths types of locks is 0. An application can set
  102.       the threshold to 0xFF which disables implicit transactions for that lock
  103.       until the application terminates or resets the values. }
  104.     {#F}
  105.     {}
  106.     { LogicalRecordLockThreshold : contains the current setting for logical
  107.                               record locks. }
  108.     { PhysicalRecordLockThreshold: contains the current setting for physical
  109.                               record locks. }
  110.     {#F}
  111.     {#X TTSSetApplicationThresholds}
  112.  
  113.     function TTSGetTransactionBits (var TransactionBits : byte) : word;
  114.     { Returns the transaction bits (control flags) for a task. Only bit 0 is
  115.       used. If bit 0 is set then forced record locking is on. The default state
  116.       of forced record locking is on. All other bits are reserved. }
  117.     {#F}
  118.     {}
  119.     { TransactionBits: contains the current transaction bit setting. }
  120.     {#F}
  121.     {#X TTSSetTransactionBits }
  122.  
  123.     FUNCTION TTSGetWorkStationThresholds (VAR LogicalRecordLockThreshold,
  124.                                           PhysicalRecordLockThreshold : byte) : WORD;
  125.     { This function allows a station to determine the number of logical and
  126.       physical record locks allowed before an implicit transaction is started. }
  127.     {#F}
  128.     {}
  129.     { LogicalRecordLockThreshold : contains the current setting for logical
  130.                               record locks. }
  131.     { PhysicalRecordLockThreshold: contains the current setting for physical
  132.                               record locks. }
  133.     {#F}
  134.     {#X TTSSetWorkStationThresholds }
  135.  
  136.     FUNCTION TTSIsAvailable : WORD;
  137.     { Verifies whether the default file server supports transaction tracking. }
  138.  
  139.     FUNCTION TTSSetApplicationThresholds (LogicalRecordLockThreshold,
  140.                                           PhysicalRecordLockThreshold : BYTE) : WORD;
  141.     { Allows an application to set the number of logical and physical record
  142.       locks allowed before an implicit transaction is started. For example, if a
  143.       threshold value is 0 then when the first lock is made for that particular
  144.       lock an implicit transaction is started. Thus, if the threshold is 50 then
  145.       on the 51st lock an implicit transaction is started. The default values
  146.       for boths types of locks is 0. An application can set the threshold to
  147.       0xFF which disables implicit transactions for that lock until the
  148.       application terminates or resets the values. }
  149.     {#F}
  150.     {}
  151.     { LogicalRecordLockThreshold : contains the new setting for logical record
  152.                               locks. }
  153.     { PhysicalRecordLockThreshold: contains the new setting for physical record
  154.                               locks. }
  155.     {#F}
  156.     {#X TTSGetApplicationThresholds }
  157.  
  158.     function TTSSetTransactionBits (TransactionBits : byte) : word;
  159.     { Allows an application to set the transaction bits (control flags). If bit
  160.       0 of the transaction bits is set then forced record locking is ON. If
  161.       clear forced record locking is OFF. The default is bit 0 set. }
  162.     {#F}
  163.     {}
  164.     { TransactionBits: contains the new transaction bit settings. }
  165.     {#F}
  166.     {#X TTSGetTransactionBits }
  167.  
  168.     FUNCTION TTSSetWorkStationThresholds (LogicalRecordLockThreshold,
  169.                                           PhysicalRecordLockThreshold : BYTE) : WORD;
  170.     { This function allows a station to set the number of logical and physical
  171.       record locks allowed before an implicit transaction is started. The values
  172.       set by this function call continue to be valid for all applications run
  173.       on the particular workstation until another call is made to this function,
  174.       SETTTS is run or an EndOfJob call is made (threshold levels are reset
  175.       to 0). }
  176.     {#F}
  177.     {}
  178.     { LogicalRecordLockThreshold : contains the new setting for logical record
  179.                               locks. }
  180.     { PhysicalRecordLockThreshold: contains the new setting for physical record
  181.                               locks. }
  182.     {#F}
  183.     {#X TTSGetWorkStationThresholds }
  184.  
  185.     FUNCTION TTSTransactionStatus (TransactionNumber : longint) : WORD;
  186.     { Verifies whether a transaction has been written to disk. Transactions
  187.       are written to the disk in the order in which they ended. }
  188.     {#F}
  189.     {}
  190.     { TransactionNumber: contains the transaction number to verify if it has
  191.                     been written to disk. }
  192.     {#F}
  193.     {#X TTSEndTransaction }
  194.  
  195.     DESTRUCTOR Done; VIRTUAL;
  196.  
  197.   END;
  198.  
  199.